<?php
ini_set('date.timezone','Asia/Shanghai');
$postData=array();
$postData['accountname']="kaifa";
$postData['accountpassword']="1111112";

$headerIp = array(
    'CLIENT-IP:1.2.3.4',
    'X-FORWARDED-FOR:8.8.8.8',
    'test:wl',
    'REFERER:ttttt',
);
$refer = 'http://www.baidu.com';



$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,'http://plat1.wlphp.tk/zsadmin.php/Login/login.html');
//伪造来源refer
curl_setopt($ch, CURLOPT_REFERER, $refer);
//伪造来源ip
curl_setopt($ch, CURLOPT_HTTPHEADER, $headerIp);
//提交post传参
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
// 获取的信息以文件流的形式返回，而不是直接输出。
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
//模拟用户使用的浏览器，在HTTP请求中包含一个”user-agent”头的字符串。
curl_setopt($ch, CURLOPT_USERAGENT, "iphone 10x");
//...各种curl属性参数设置
$out_put = curl_exec($ch);
logRes($out_put);
curl_close($ch);
echo ($out_put);die;



/**
 * 文本记录函数
 * @param string $word 输入记录的值
 */
function logRes($word = '')
{
    $logname = "./log/" . date("Ymd") . ".txt";
    $fp = fopen($logname, "a");
    flock($fp, LOCK_EX);
    fwrite($fp, "执行日期：" . strftime("%Y-%m-%d %H:%M:%S", time()) . "\r\n" . $word . "\r\n");
    flock($fp, LOCK_UN);
    fclose($fp);
}